<div class="panel panel-default">
	<div class="panel-heading">
		<?php 
		$this->widget('zii.widgets.CBreadcrumbs',array(
				'links'=>array(
						'后台管理',
						'栏目列表'
		)
		));
		?>
	</div>
	<div class="panel-body">
		<p class="text-right">
			<a class="btn btn-primary" href="<?php echo $this->createUrl('category/add'); ?>">商标添加</a>
		</p>
		<table class="table table-hover">
		<thead>
			<tr>
				<th>栏目序号</th>
				<th>栏目名称</th>
				<th>标识</th>
				<th>模版</th>
				<th>排序</th>
				<th>操作</th>
			</tr>
			</thead>
			<?php foreach($cateList as $v):?>
			<tr>
				<td><?php echo $v['category_id'];?></td>
				<td><?php echo $v['html'] . '|—' .$v['title'];?></td>
				<td><?php echo $v['name'];?></td>
				<td><?php echo $v['template'];?></td>
				<td><?php echo $v['sort'];?></td>
				<td>
					<a href="<?php echo $this->createUrl('edit',array('cid'=>$v['category_id']));?>">编辑</a>
					<a class="delete" href="<?php echo $this->createUrl('delete',array('cid'=>$v['category_id']));?>">删除</a>
				</td>
			</tr>
			<?php endforeach?>
		</table>
	</div>
</div>
<script>
	$(function(){
		$('.delete').click(function(){
			if(!confirm('确定要删除吗？')){
				return false;
				}
			$a = $(this);
			$.ajax({
				url : $(this).attr('href'),
				success : function(data){
					data = eval('(' + data + ')' );
					if(data.status == 1){
							$a.parents('tr').remove();
						} else {
							alert(data.message);
							}
					}
				});
		    return false;
		});
	});
</script>